package com.lsz.crm.service;

import com.lsz.crm.base.BaseService;
import com.lsz.crm.mapper.PermissionMapper;
import com.lsz.crm.pojo.Permission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author liushizhong
 * @Date 2021/10/31 17:43
 * @Version 1.0
 */

@Service
public class PermissionService extends BaseService<Permission,Integer> {

    @Autowired
    private PermissionMapper permissionMapper;

    /**
     * 通过查询用户拥有的角色，得到用户拥有的资源列表 （资源权限码）
     * @param userId
     * @return
     */
    public List<String> queryUserHasRoleHasPermissionsByRoleId(Integer userId) {
        return permissionMapper.queryUserHasRoleHasPermissionsByRoleId(userId);
    }
}
